﻿@{
    Layout = "~/Views/Shared/_Layout_RTU_block.cshtml";
    ViewBag.Title = "WarningsandAlerts";
}

<div class="xds-no-breadcrumb">
    <div class="full-height">
        <div class="full-height-scroll white-bg border-left">
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-primary" id="list-panel">
                        <div class="panel-heading">
                            <h1 class="panel-title">报警记录-每口油井5条最新记录</h1>
                        </div>
                        <div class="panel-body">
                            <table id="assets-data-table" class="table table-striped table-bordered" style="width:100%"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@section Styles {
    @Styles.Render("~/Content/datatables")
    @Styles.Render("~/plugins/sweetAlertStyles")
}

@section Scripts {
    @Scripts.Render("~/bundles/datatables")
    @Scripts.Render("~/plugins/sweetAlert")
<script type="text/javascript">
    var assetListVM;
    assetListVM = {
        dt: null,
        reload: function () {
            dt.ajax.url("@Url.Action("Get","WarnLog")" + "?blockid=" + sessionStorage.blockid).load();
        },
        init: function () {
            dt = $("#assets-data-table").DataTable({
                "serverSide": true,
                "proccessing": true,
                "ajax": {
                    "url": "@Url.Action("Get","WarnLog")" + "?blockid=" + sessionStorage.blockid
                },
                "columns": [
                    //{ "title": "报警记录ID", "data": "ID", "searchable": true },
                    //{ "title": "井号", "data": "WELL_ID", "searchable": true },
                    //{ "title": "报警开始时间", "data": "ActionTime" },
                    //{ "title": "报警信息", "data": "Describe", "searchable": true },
                    //{ "title": "报警结束时间", "data": "ErrorEndTime" },
                    //{ "title": "报警记录状态", "data": "YorN", "searchable": true }
                    { "title": "Alarm Record #", "data": "ID", "searchable": true },
                    { "title": "Well No.", "data": "WELL_ID", "searchable": true },
                    { "title": "Alarm Received (Date and Time)", "data": "ActionTime" },
                    { "title": "Alarm Info", "data": "Describe", "searchable": true },
                    { "title": "Alarm Dismissed (Date and Time)", "data": "ErrorEndTime" },
                    { "title": "Status", "data": "YorN", "searchable": true }
                ],
                "lengthMenu": [[10, 25, 50, 100], [10, 25, 50, 100]],
                //"language": {
                //    "processing": "处理中...",
                //    "lengthMenu": "显示 _MENU_ 项结果",
                //    "zeroRecords": "没有匹配结果",
                //    "info": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                //    "infoEmpty": "显示第 0 至 0 项结果，共 0 项",
                //    "infoFiltered": "(由 _MAX_ 项结果过滤)",
                //    "infoPostFix": "",
                //    "search": "搜索:",
                //    "searchPlaceholder": "搜索...",
                //    "url": "",
                //    "emptyTable": "表中数据为空",
                //    "loadingRecords": "载入中...",
                //    "infoThousands": ",",
                //    "paginate": {
                //        "first": "首页",
                //        "previous": "上页",
                //        "next": "下页",
                //        "last": "末页"
                //    },
                //    "aria": {
                //        paginate: {
                //            first: '首页',
                //            previous: '上页',
                //            next: '下页',
                //            last: '末页'
                //        },
                //        "sortAscending": ": 以升序排列此列",
                //        "sortDescending": ": 以降序排列此列"
                //    },
                //    "decimal": "-",
                //    "thousands": ","
                //}
            });
        }
    };
    $(document).ready(function () {
        assetListVM.init();
    });
    function refresh() {
        assetListVM.reload();
    }
</script>
}
